from selenium import webdriver
from time import sleep

from selenium.webdriver.common.by import By
dr = webdriver.Chrome()
dr.get('https://www.baidu.com')
dr.find_element(By.XPATH, '//form/span[1]/input').send_keys('book')
dr.find_element(By.XPATH,'//input[@id="kw" and @name="wd" and @maxlength="255"]').send_keys('mobile')
dr.find_element(By.CSS_SELECTOR,'#kw').send_keys('moblie')
sleep(1)
dr.find_element(By.CSS_SELECTOR,'.s_ipt').clear()
sleep(1)
dr.find_element(By.CSS_SELECTOR,'input[name="wd"]').send_keys('Book')
sleep(1)
dr.find_element(By.CSS_SELECTOR,'[name="wd"][maxlength="255"][value=""]').clear()
# dr.get('https://www.baidu.com')
# dr.maximize_window()
sleep(5)

dr.quit()
